﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DTO
{    
    public class DTOUser
    {
        public int id { get; set; }
        public string username { get; set; }
        public string password { get; set; }
        public string fullname { get; set; }
        public string address { get; set; }
        public string phonenum { get; set; }
        public string usertype { get; set; }
        public DateTime created { get; set; }
    }
    public class Valid_Input
    {
        public static bool Check_input(string values)
        {
            if (string.IsNullOrEmpty(values))
            {
                return true;
            }
            if (string.IsNullOrWhiteSpace(values))
            {
                return true;
            }
            return false;
        }
        public static bool Check_number(string num)
        {
            foreach (char chr in num)
            {
                if (char.IsDigit(chr) == false)
                {
                    return true;
                }
            }
            return false;
        }
        public static bool Check_lenght_password(string num1)
        {
            if (num1.Length < 6 || num1.Length > 15)
            {
                return true; // be hoac lon hon chieu dai quy dinh.
            }
            else return false;
        }
        public static bool Check_lenght_phone(string num)
        {
            if (num.Length >= 8 && num.Length <= 11)
            {
                return false;
            }
            else return true; //vuot qua do dai cua dien thoai co dinh hoac di dong.
        }
    }
}
